home *** CD-ROM | disk | FTP | other *** search
- /* PDoMenuTextMaster Handle a selection of the menu bar */
-
- /* Unit name: PDoMenuTextMaster.c */
- /* Function: This module calls the appropiate menu list */
- /* handler routine. */
- /* History: 5/9/91 Original by Prototyper 3.0 */
-
-
- #include "PCommonTextMaster.h" /* Common */
- #include "Common_TextMaster.h" /* Common */
- #include "PUtils_TextMaster.h" /* General Utilities */
- #include "Utils_TextMaster.h" /* General Utilities */
-
- #include "AppleMenu.h" /* Menu handlers */
- #include "FileMenu.h" /* Menu handlers */
- #include "EditMenu.h" /* Menu handlers */
- #include "PD_About_Dialog.h" /* Modal Dialog */
- #include "PD_Help_window.h" /* Modal Dialog */
- #include "PD_Help_window_2.h" /* Modal Dialog */
- #include "DoMenuTextMaster.h" /* Extra menu handler */
-
- #include "PDoMenuTextMaster.h" /* This file */
-
- #include "tm.h" /* Special #defines for TextMaster */
-
-
- /* ======================================================= */
-
- void DoMenuApple(short theItem); /* Handle this menu list */
- void DoMenuFile(short theItem); /* Handle this menu list */
- void DoMenuEdit(short theItem); /* Handle this menu list */
-
- /* ======================================================= */
-
-
- /* ======================================================= */
-
-
- /* Routine: DoMenuApple */
- /* Purpose: Handle all menu items in this list */
-
- void DoMenuApple( theItem) /* Handle this menu selection */
- short theItem;
- {
- Boolean SkipProcessing; /* TRUE says skip processing */
- short DNA; /* For opening DAs */
- Str255 DAName; /* For getting DA name */
- GrafPtr SavePort; /* Save current port when opening DAs */
-
-
-
- SkipProcessing = FALSE; /* Set to not skip the processing of this menu item */
-
- Do_AppleMenu(TRUE,theItem,&SkipProcessing); /* Pre menu handler */
-
- if (SkipProcessing == FALSE) /* See if process the menu list */
- {
-
- switch (theItem) { /* Handle all commands in this menu list */
-
- case MItem_About_TextMaste:
- PD_About_Dialog(); /* Call a modal dialog */
- break;
-
- default: /* Handle the DAs */
- GetPort(&SavePort); /* Save the current port */
- GetItem(Menu_Apple, theItem, DAName); /* Get the name of the DA selected */
- DNA = OpenDeskAcc(DAName); /* Open the DA selected */
- SetPort(SavePort); /* Restore to the saved port */
- break;
-
- } /* End of item case */
-
- } /* End of not SkipProcessing */
-
- Do_AppleMenu(FALSE,theItem,&SkipProcessing); /* Post menu handler */
-
- } /* End of procedure */
-
- /* ======================================================= */
-
-
- /* Routine: DoMenuFile */
- /* Purpose: Handle all menu items in this list */
-
- void DoMenuFile( theItem) /* Handle this menu selection */
- short theItem;
- {
- Boolean SkipProcessing; /* TRUE says skip processing */
-
-
-
- SkipProcessing = FALSE; /* Set to not skip the processing of this menu item */
-
- Do_FileMenu(TRUE,theItem,&SkipProcessing); /* Pre menu handler */
-
- if (SkipProcessing == FALSE) /* See if process the menu list */
- {
-
- switch (theItem) { /* Handle all commands in this menu list */
-
- case MItem_UNIX____Macinto:
- call_tm(UNIX_TO_MAC);
- break;
-
- case MItem_Macintosh____UN:
- call_tm(MAC_TO_UNIX);
- break;
-
- case MItem_Help:
- PD_Help_window(); /* Call a modal dialog */
- break;
-
- case MItem_Quit:
- doneFlag = TRUE;
- break;
-
- default:
- break;
-
- } /* End of item case */
-
- } /* End of not SkipProcessing */
-
- Do_FileMenu(FALSE,theItem,&SkipProcessing); /* Post menu handler */
-
- } /* End of procedure */
-
- /* ======================================================= */
-
-
- /* Routine: DoMenuEdit */
- /* Purpose: Handle all menu items in this list */
-
- void DoMenuEdit( theItem) /* Handle this menu selection */
- short theItem;
- {
- Boolean SkipProcessing; /* TRUE says skip processing */
- Boolean BoolHolder; /* For SystemEdit result */
-
-
-
- SkipProcessing = FALSE; /* Set to not skip the processing of this menu item */
-
- Do_EditMenu(TRUE,theItem,&SkipProcessing); /* Pre menu handler */
-
- if (SkipProcessing == FALSE) /* See if process the menu list */
- {
-
- BoolHolder = SystemEdit ( theItem - 1 ); /* Let the DA do the edit to itself */
-
- if (BoolHolder == FALSE) /* If not a DA then we get it */
- { /* Handle by using a Case statment */
-
- switch (theItem) { /* Handle all commands in this menu list */
-
- case MItem_Undo:
- break;
-
- case MItem_Cut:
- break;
-
- case MItem_Copy:
- break;
-
- case MItem_Paste:
- break;
-
- case MItem_Clear:
- break;
-
- case MItem_Select_All:
- break;
-
- case MItem_Show_Clipboard:
- break;
-
- default: /* Send to a DA */
- break;
-
- } /* End of item case */
- } /* End of not BoolHolder */
-
- } /* End of not SkipProcessing */
-
- Do_EditMenu(FALSE,theItem,&SkipProcessing); /* Post menu handler */
-
- } /* End of procedure */
-
- /* ======================================================= */
-
- /* Routine: Handle_My_Menu */
- /* Purpose: Vector off to the appropiate menu list handler */
-
- void Handle_My_Menu( theMenu, theItem)
- short theMenu;
- short theItem;
- {
-
-
- switch (theMenu) /* Do selected menu list */
- {
-
- case Res_Menu_Apple:
- DoMenuApple(theItem); /* Go handle this menu list */
- break;
-
- case Res_Menu_File:
- DoMenuFile(theItem); /* Go handle this menu list */
- break;
-
- case Res_Menu_Edit:
- DoMenuEdit(theItem); /* Go handle this menu list */
- break;
-
- default:
- Handle_Other_Menus(theMenu,theItem); /* Handle other special menus */
- break;
-
- } /* End for the Lists */
-
- HiliteMenu(0); /* Turn menu selection off */
- } /* End of procedure Handle_My_Menu */
-
-